#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int dianshu(int number)
{
	char *count1 = (char *)malloc(number*6);
	char *count2 = (char *)malloc(number*6);
	memset(count1, 0, number*6);
	memset(count2, 0, number*6);
	for (int i = 0; i < 6; ++i) {
	    count1[i] = 1;
	}
	for (int i = 1; i < number; ++i) {
		int sum6 = 0;
		for (int j = 6*(i-1); j < 6*i; ++j) 
		{
		    sum6 += count1[j];
		}
		for (int j = i; j < 6*i; ++j) {
			count2[j] = sum6;
			sum6 -= count1[j-6];
			sum6 += count1[j];
		}
		char * tmp = count1; 
		count1 = count2; 
		count2 = tmp;
 	}
 	
 	for (int i = 5; i < number*6; ++i) {
	 	printf("%d: %d\n", i+1, count1[i]);
 	}
}

/*
int main()
{
	dianshu(6);
}
*/
